﻿/// <summary>** BEGIN LICENSE BLOCK *****
/// Version: LGPL 3
/// 
/// Copyright 2008 David Cumps <david@cumps.be>
/// 
/// This file is part of ArmoryLib2.
///
/// ArmoryLib is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License as published by
/// the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// ArmoryLib is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with ArmoryLib2.  If not, see <http://www.gnu.org/licenses/>.
/// **** END LICENSE BLOCK ****
/// </summary>

namespace ArmoryLib2.Character.MeleeDetail
{
    // <critChance percent="19.90" plusPercent="7.29" rating="161"/>
    public class Crit
    {
        private int _rating;
        public int Rating
        {
            get { return _rating; }
            private set { _rating = value; }
        }

        private double _addedCritPercent;
        public double AddedCritPercent
        {
            get { return _addedCritPercent; }
            private set { _addedCritPercent = value; }
        }

        private double _percent;
        public double Percent
        {
            get { return _percent; }
            private set { _percent = value; }
        }

        internal Crit(int rating, double percent, double plusPercent)
        {
            Rating = rating;
            Percent = percent;
            AddedCritPercent = plusPercent;
        }

        public override string ToString()
        {
            return string.Format("Rating: {0} (+{1}%), Crit%: {2}%",
                                 Rating,
                                 AddedCritPercent,
                                 Percent);
        }
    }
}
